#ifndef _FREE_EGUI_H_
#define _FREE_EGUI_H_

#include <stdint.h>
#include <stdbool.h>

typedef struct
{
	uint16_t width;
	uint16_t height;
	void *data;
	enum BmpMode
	{
		BMP_MODE_MONO,
		BMP_MODE_RGB565
	} mode;

} Bitmap;

void egui_clear(Bitmap *bmp);

void egui_draw_pixel(Bitmap *bmp, int16_t x, int16_t y, uint32_t color);

uint32_t egui_read_pixel(Bitmap *bmp, int16_t x, int16_t y);

void egui_inverse_pixel(Bitmap *bmp, int16_t x, int16_t y);

void egui_draw_line(Bitmap *bmp, int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint32_t color);

void egui_draw_rect(Bitmap *bmp, int16_t x, int16_t y, int16_t w, int16_t h, uint32_t color);

void egui_fill_rect(Bitmap *bmp, int16_t x, int16_t y, int16_t w, int16_t h, uint32_t color);

void egui_inverse_rect(Bitmap *bmp, int16_t x, int16_t y, int16_t w, int16_t h);

void egui_draw_bitmap(Bitmap *bmp_panel, Bitmap *bmp_layer, int16_t x, int16_t y);

void egui_draw_string(Bitmap *bmp, int16_t x, int16_t y, int16_t font_size, const char *str);

void egui_cal_scale(Bitmap *bmp0, Bitmap *bmp1, float scale);

void egui_cal_rotate_point(int center_x, int center_y, int *origin_x, int *origin_y, int angle);

uint16_t egui_rgb565(uint8_t r, uint8_t g, uint8_t b);

#endif // _FREE_EGUI_H_
